<?php

	require_once('../includes/config.php');
	require_once('../core/database.php');
	require_once(dirname(__FILE__)."/../core/safeParam.php");
	require_once('../core/functions.php');
	require_once('../core/menu.php');
	
	$adminMenu = new menu();
	$function=$_GET['function'];
	
	switch($function) {
		case "add-menu" :
  			$adminMenu->menusAdd($_POST);
  		break;

		case "edit-menu" :
  			$adminMenu->menusModify($_POST);
  		break;

		case "delete-menu" :
  			$adminMenu->menusDelete($_GET['id']);
  		break;

		case "add-category" :
  			$adminMenu->menusCategoryAdd($_POST, $_FILES);
  		break;
		
		case "edit-category" :
  			$adminMenu->menusCategoryModify($_POST, $_FILES);
  		break;

		case "delete-category" :
  			$adminMenu->menusCategoryDelete($_GET);
  		break;

		case "add-item" :
  			$adminMenu->menusItemAdd($_POST, $_FILES);
  		break;

		case "edit-item" :
  			$adminMenu->menusItemModify($_POST, $_FILES);
  		break;

		case "delete-item" :
  			$adminMenu->menusItemDelete($_GET);
  		break;

		case "edit-home" :
  			$adminMenu->editHome($_POST);
  		break;

		case "edit-config-vars" :
  			$adminMenu->editConfigVars($_POST,$_FILES);
  		break;

		case "edit-config" :
  			$adminMenu->editConfig($_POST,$_FILES);
  		break;

		case "add-config" :
  			$adminMenu->addConfig($_POST,$_FILES);
  		break;

		case "delete-config" :
  			$adminMenu->deleteConfig($_GET['id']);
  		break;

		case "edit-gateway" :
  			$adminMenu->editGateway($_POST);
  		break;

		case "edit-gateway-vars" :
  			$adminMenu->editGatewayVars($_POST);
  		break;
		
		case "add-option" :
  			$adminMenu->addOption($_POST);
  		break;

		case "add-option-item" :
  			$adminMenu->addOptionItem($_POST);
  		break;

		case "edit-option" :
  			$adminMenu->editOption($_POST);
  		break;

		case "edit-option-item" :
  			$adminMenu->editOptionItem($_POST);
  		break;

		case "delete-option-set" :
  			$adminMenu->deleteOption($_GET);
  		break;

		case "delete-option-item" :
  			$adminMenu->deleteOptionItem($_GET);
  		break;

		case "copy-options" :
  			$adminMenu->copyOptions($_POST);
  		break;

		case "import":
  			$adminMenu->Import($_POST,$_FILES);
  		break;
  		
  		case "order-cats" :
  			$adminMenu->orderCats($_POST);
  		break;

	}
?>
